﻿using System;
using System.Collections.Generic;
using BotonJXC.Entity;
using RoleDAO = BotonJXC.DAO.RoleDAO;
using BotonJXC.Util;
using NHibernate.Criterion;

namespace BotonJXC.BLL
{
    public class RoleBLL : BaseBLL<RoleDAO, Role, int>
    {
        public RoleBLL()
        {
        }

        public PageModel<Role> Find(string roleName, int start, int count)
        {
            List<ICriterion> criterions = new List<ICriterion>();
            if (!string.IsNullOrEmpty(roleName))
            {
                criterions.Add(Restrictions.Like("RoleName", roleName, MatchMode.Anywhere));
            }
            return Dao.FindByPage(criterions.ToArray(), null, start, count);
        }
    }
}